package com.park.web.job;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import com.park.client.model.article.ArticleModel;
import com.park.client.service.article.ArticleService;
import com.park.common.empty.EmptyUtils;
import com.park.web.enums.ArticleStatusEnum;

/**
 * 文章自动审核定时器
 * @author daihuajun
 *
 */
@DisallowConcurrentExecution
public class ArticleAutomaticAuditJob  implements Job{
	private static final Log log = LogFactory.getLog(ArticleAutomaticAuditJob.class);

	@Autowired
	private ArticleService articleService;
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		//查询待审核的文章
		ArticleModel article = new ArticleModel();
		article.setStatus(ArticleStatusEnum.STATUS_1.code);
		List<ArticleModel> articleList = articleService.selectByStatus(article);
		if(EmptyUtils.isEmpty(articleList)){
			return;
		}
		
		
	}
	

}
